package medOffice;
import junit.framework.Assert;

import org.junit.Before;
import org.junit.Test;


/**
 * Testes da Classe Paciente
 * @author Ana Clara Lacerda
 */
public class TestesPaciente {

	Paciente p1, p2;
	PlanoDeSaude ps1, ps2;
	
	public class PacienteConcreto extends Paciente {

		public PacienteConcreto(String nome) throws Exception {
			super(nome);
		}
		
		public PacienteConcreto(String nome, String cpf, PlanoDeSaude ps) throws Exception{
			super(nome, cpf, ps);
		}
	}
	
	@Before
	public void setUp() throws Exception {
		p1 = new PacienteConcreto("Joao Maria");
		ps1  = new PlanoDeSaude("Unimed", "(83) 3333-3315", 50.0, 100.0, 2);
		p2 = new PacienteConcreto("Maria Joao", "063122214-17", ps1 );
		ps2 = new PlanoDeSaude("Unimedd", "(83) 3333-1933", 50.0, 100.0, 2);
	}
	
	@Test
	public void testAddPlanoDeSaude() throws Exception {
		p1.setPlanoDeSaude(ps1);
		Assert.assertNotNull("erro no plano de saude",p2.getPlanoDeSaude());
		Assert.assertNotNull("erro no plano de saude",p1.getPlanoDeSaude());
		p2.setPlanoDeSaude(ps2);
		Assert.assertEquals("erro no plano de saude", ps2, p2.getPlanoDeSaude());
	}
}